# install package librarian if neededif (!("librarian"%in%rownames(installed.packages()))) {install.packages("librarian")}# load required packageslibrarian::shelf( tidyverse, fs, usmap, ggpubr, sessioninfo)# Source required functionsmyFunctions <-c("FUNStormEventsData_filterData")for (f in myFunctions) {source(paste0("../functions/", f, ".R"))}# Preperations to show states boundariespoly_states <-plot_usmap(regions ="states")# Read in data_details_fipsfileName <-"data_details_fips.RDS"pathName <-"../data/stormData"filePath <-dir_ls(path = pathName, regexp =paste0(fileName, "$")) %>%last()data_details_fips <-readRDS(filePath)
1 Purpose & Rationale
As outlined in the Registered Report, we will assess the number of extreme weather episodes recorded in each participant’s county of residence within the 30 days prior to study completion. Regarding the time window during which we plan to conduct the study, we aim for maximizing the likelihood of capturing suitable variability in the exposure to extreme weather episodes with notable geographic variability. To this end, we analyzed records of extreme weather episodes over the last ten years.
2 Filter Data
We filter the storm events data for the specific years, months, and extreme weather event types we are interested in. We filter for all years from 2014 to 2023 (as data are not complete for the year 2024 yet), we highlight the month of July, and we focus on those types of extreme weather events that are predicted to increase in frequency and severity due to climate change (IPCC 2023): Excessive Heat, Drought, Wildfire, Flash Flood, Coastal Flood, Strong Wind, Hail, and Tornado.
p.hist <- out$dataForHist %>%group_by(year) %>%mutate(max_nEpisodes =max(nEpisodes),yearlyMean_nEpisodes =mean(nEpisodes) ) %>%ungroup() %>%mutate(max_month =ifelse(nEpisodes == max_nEpisodes, TRUE, FALSE)) %>%ggplot(aes(x = month_name, y = nEpisodes,linewidth = max_month,fill = month_name %in% myMonths )) +geom_hline(mapping =aes(yintercept = yearlyMean_nEpisodes),linetype ="dashed",color ="black" ) +geom_bar(stat ="identity",color ="black",alpha = .7,show.legend =FALSE ) +scale_linewidth_manual(values =c(0.5, 2)) +scale_x_discrete(labels = month.abb) +scale_fill_manual(values =c("darkgrey", "orange"), ) +labs(title ="Number of Extreme Weather Episodes by Month over the Years 2014 to 2023",x ="Month",y ="Number of Episodes" ) +theme_bw() +theme(text =element_text(size =15),plot.title =element_text(hjust = .5),axis.text.x =element_text(angle =90, hjust =1, vjust =0.5) ) +facet_wrap(~year, ncol =5)jpeg(file ="../images/histogramSeasonalDistribution.jpeg",width =14, height =7.5, units ="in", res =600)print(p.hist)invisible(dev.off())
Show the code
p.map_bin <-plot_usmap(data = out$dataForUsPlot,values ="episodes_bin",regions ="counties",exclude =c("AK", "HI"),color ="black",linewidth =0.1 ) +geom_sf(data = poly_states[[1]] %>%filter(!(abbr %in%c("AK", "HI"))),color ="black",fill =NA,linewidth = .3 ) +scale_fill_manual(name ="Number of Episodes > 0",values =c("white", "orange") ) +labs(title ="Extreme Weather Episodes in July over the Years 2014 to 2023" ) +theme_bw() +theme(text =element_text(size =15),legend.position ="bottom",plot.title =element_text(hjust = .5),panel.grid =element_blank(),axis.ticks =element_blank(),axis.text =element_blank() ) +facet_wrap(~year, ncol =5)jpeg(file ="../images/mapGeographicalDistribution_bin.jpeg",width =14, height =7.5, units ="in", res =600)print(p.map_bin)invisible(dev.off())
Analyzing the seasonal distribution of extreme weather episodes, Figure 1 shows that July consistently shows a high number of extreme weather episodes over the last ten years. Additionally, Figure 2 indicates that withing the month of July, these extreme weather episodes also display a high geographical variability.
Figure 1: Histograms showing the number of extreme weather episodes by month from 2014 to 2023. The dashed horizontal line indicates the mean number of extreme weather episodes in each year. The thick-bordered bar marks the month with the most extreme weather events each year. The orange bar represents July. July had the most extreme weather events in 4 out of 10 years, and in another 4 years, it was right before or after the peak month. Only episodes that included at least one of the following event types were considered: excessive heat, drought, wildfire, flash flood, coastal flood, strong wind, hail, tornado.